The Earth's magnetic field - known as the "magnetosphere" - protects our atmosphere from the "solar wind." That's the constant stream of charged particles flowing outward from the sun. When the magnetosphere shields Earth from these solar particles, they get funneled toward the polar regions of our atmosphere.